using Gateway.Common.Entity;

namespace Gateway.Domain.Entities;
public class DescribeDomain: AggregateRootEntityBase
{
    public string DomainName { get;private set; }
    public string DomainId { get;private set; }
    public bool AliDomain { get;private set; }
    public string InstanceEndTime { get;private set; }
    public bool InstanceExpired { get;private set; }
    public string DnsServers { get;private set; }
    public DateTime? ModifiedTime { get;private set; }
    public string Endpoint { get;private set; }
    /// <summary>
    /// 记录
    /// </summary>
    public List<DescribeDomainRecord> Records { get; private set; }
    public DescribeDomain() { }

    public DescribeDomain(string domainName, string domainId, bool aliDomain, string instanceEndTime, bool instanceExpired, string dnsServers, string endpoint)
    {
        DomainName = domainName;
        DomainId = domainId;
        AliDomain = aliDomain;
        InstanceEndTime = instanceEndTime;
        InstanceExpired = instanceExpired;
        DnsServers = dnsServers;
        ModifiedTime = DateTime.Now;
        Endpoint = endpoint;
    }

    public void SetRecord(List<DescribeDomainRecord> records)
    {
        Records = records;
    }


    public void Update(string domainName, string domainId, bool aliDomain, string instanceEndTime, bool instanceExpired, string dnsServers, string endpoint)
    {
        DomainName = domainName;
        DomainId = domainId;
        AliDomain = aliDomain;
        InstanceEndTime = instanceEndTime;
        InstanceExpired = instanceExpired;
        DnsServers = dnsServers;

        ModifiedTime = DateTime.Now;
        Endpoint = endpoint;
    }
}